<template>
  <div class="shezhi-contianer">
    <van-nav-bar
      title="设置"
      left-arrow
      @click-left="onClickLeft"
      placeholder
    />

    <div class="shezhiList">
      <p>
        <span>检查版本</span>
        <van-icon name="arrow" />
      </p>
      <p>
        <span>功能介绍</span>
        <van-icon name="arrow" />
      </p>
      <p>
        <span>新消息通知</span>
        <van-icon name="arrow" />
      </p>
      <p>
        <span>关于我们</span>
        <van-icon name="arrow" />
      </p>
    </div>

    <button @click="loginOut">退出登录</button>
  </div>
</template>

<script>
export default {
  methods: {
    onClickLeft () {
      this.$router.back()
    },
    // 退出登录 并且删除内存中的userToken
    loginOut () {
      localStorage.removeItem('userToken')
      this.$router.replace('/login')
    }
  }
}
</script>

<style lang='less' scoped>
.shezhi-contianer {
  width: 100%;
  .shezhiList {
    margin-top: 1.1111rem;
    border-bottom: 1px solid rgb(231, 230, 230);
    padding-bottom: 1.1111rem;
    p {
      padding: 1.1111rem 1.1111rem;
      display: flex;
      justify-content: space-between;
    }
  }
  button {
    width: 100%;
    height: 2.5rem;
    outline: none;
    background-color: red;
    border: 0;
    margin-top: 1.6667rem;
    color: #fff;
    font-size: 1.1111rem;
    font-weight: 700;
  }
}

</style>
